<template>
  <div class="user-card">
    <div>
      <img class="tool-avatar" :src="user.avatar || 'http://110.40.229.202//api/pms/images/18952334-4f0c-442a-ae7d-911949fd1895.jpg'"
           alt="avatar"/>
    </div>
    <el-tooltip :content=" `昵称:` + user.nickname" placement="top">
      <div>
        <span class="tool-user">{{user.nickname}}</span>
      </div>
    </el-tooltip>
  </div>
</template>

<script>

import {getCache} from "@/utils/local_cache";

export default {
  name: "UserCard",
  data() {
    return {
      user: {}
    }
  },
  mounted() {
    this.user = getCache('user')
  }
}

</script>


<style scoped>

.user-card{
  display: flex;
  gap: 5px;
  align-content: center;
  align-items: center;
  flex-direction: row;
}

.tool-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  line-height: 24px;
}

.tool-user{
  font-size: 12px;
  color: #fff;
  font-weight: 500;
  line-height: 12px;
}




@media (max-width: 1366px){
  .tool-avatar {
    width: 20px;
    height: 20px;
  }

  .tool-user {
    font-size: 11px;
  }
}
</style>